package com.itheima.wemedia.feign;

import com.itheima.common.vo.ResultVo;
import com.itheima.wemedia.pojo.WmNews;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "leadnews-wemedia", contextId = "wmNewsFeign")
public interface WmNewsFeign {

    /**
     * 通过id查询文章信息
     * @param wmNewsId
     * @return
     */
    @GetMapping("/api/wmNews/{wmNewsId}")
    ResultVo<WmNews> getById(@PathVariable(name = "wmNewsId") Long wmNewsId);

    /**
     * 更新文章信息
     * @param wmNews
     * @return
     */
    @PutMapping("/api/wmNews/update")
    ResultVo<WmNews> update(@RequestBody WmNews wmNews);
}
